#ifndef SKSLINEEDIT_H
#define SKSLINEEDIT_H

#include <QLineEdit>

class SKSVirtualKeyboard;

class SKSLineEdit : public QLineEdit
{
    Q_OBJECT
public:
    explicit SKSLineEdit(QWidget *parent = nullptr);

    SKSLineEdit(const QString &contents, QWidget *parent = Q_NULLPTR);

    virtual ~SKSLineEdit() {}

signals:
    void keypressed(QKeyEvent* evt);

protected slots:
    void onSendBackspace();
    void onSendPreedit(const QString& text);
    void onSendCommit(const QString& text);
    void onSendBackEvent(QEvent* evt);

protected:
    bool eventFilter(QObject *obj, QEvent *event);

private:
    void buildConnections();

private:
    SKSVirtualKeyboard* mVirtualKeyboard;
};

#endif // SKSLINEEDIT_H
